<?php 
require_once dirname(__FILE__) . '/../../common.inc.php';
require_once dirname(__FILE__) . "/Plugin.class.php";
$obj = new Plugin();
$result1 = DbUtils::get(DbUtils::createPdoInst(), TABLE_NAME_PREFIX_PLUGIN . $obj->folder . '_config', NULL, NULL, NULL, NULL, NULL, NULL)->d;
$result2 = DbUtils::get(DbUtils::createPdoInst(), TABLE_NAME_PREFIX_PLUGIN . $obj->folder . '_email', NULL, NULL, NULL, NULL, NULL, NULL)->d;

if(count($result2)== 0){
  $to = 'abc@163.com';
  $e_id = '';
  $recepter_name = 'Sir';
  $subject = 'Subject';
  $mail_from = 'dreamlife.customerservice@gmail.com';
  $sender_name = 'Customer';
  $smtp_secure = 'ssl';
  $host = 'smtp.gmail.com';
  $port = '465';
  $username = 'dreamlife.customerservice@gmail.com';
  $password = 'luckybox4mail';
  
  $f_bgcolor = '';
  $f_bgcolor_tran = '1';
  $f_color = '#000';
  $text_border = '#ccc';
  $f_font = '';
  $f_size = '';
  $f_weight = '';
  $cellpadding = '5';
  
  $b_text = 'Send';
  $b_width = '';
  $b_height = '';
  $b_bgcolor = '#000';
  $b_color = '#fff';
  $b_font = '';
  $b_size = '';
  $b_weight = '';
} else {
foreach ($result2 as &$res)
  $e_id = $res->id;
  $to = $res->mail_to;
  $recepter_name = $res->recepter_name;
  $subject = $res->subject;
  $mail_from = $res->mail_from;
  $sender_name = $res->sender_name;
  $smtp_secure = $res->smtp_secure;
  $host = $res->host;
  $port = $res->port;
  $username = $res->username;
  $password = $res->password;
  
  $f_bgcolor = $res->f_bgcolor;
  $f_bgcolor_tran = $res->f_bgcolor_tran;
  $f_color = $res->f_color;
  $text_border = $res->text_border;
  $f_font = $res->f_font;
  $f_size = $res->f_size;
  $f_weight = $res->f_weight;
  $cellpadding = $res->cellpadding;
  
  $b_text = $res->b_text;
  $b_width = $res->b_width;
  $b_height = $res->b_height;
  $b_bgcolor = $res->b_bgcolor;
  $b_color = $res->b_color;
  $b_font = $res->b_font;
  $b_size = $res->b_size;
  $b_weight = $res->b_weight;
}
?>